<%@ page language="java" contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="/tld/extremecomponents" prefix="ec" %>
<%@ include file="../../common/common.jsp" %>	
<%@ include file="master_pass.jsp" %>
<% 	
masterLogin.hasPermission(6003);
//权限判断代码结束
Integer mgId = Utility.parseInt(request.getParameter("mgId"));

IMasterGradePermissionService masterGradePermissionService = (IMasterGradePermissionService)BeanManager.getBean("masterGradePermissionService");
masterGradePermissionService.AutoBindingTable(request);
%>


<html>
<head>
<title><%=SYSTITLE%> - 社区管理员等级权限查看</title>
<%@ include file="../../common/meta.inc" %>
<link href="css.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/extremetable/extremecomponents.css"/>
<SCRIPT LANGUAGE="javascript" SRC="${pageContext.request.contextPath}/scripts/common-validator.js"></SCRIPT>
<script language="javascript" src="${pageContext.request.contextPath}/scripts/prototype.js"></script>
<script language="javascript" src="${pageContext.request.contextPath}/scripts/buffalo/buffalo.js"></script>
<script language="javascript">
var END_POINT="${pageContext.request.contextPath}/buffalo";
var buffalo = new Buffalo(END_POINT);

function updatePermission(code,saveFlag)
{
	var mgId= <%=mgId%>;
	var permissionCode = parseInt(code);
	var flag = false;
	if(saveFlag!="CHECKED")
		flag = true;
		
	buffalo.remoteCall("masterGradePermissionServiceAjaxService.saveOrUpdate",[mgId,permissionCode,flag], function(reply) {
        var ret = reply.getResult();
        ajaxSubmit(ret,"保存成功！","reload");       
    });	
}
</script>
</head>
<body leftMargin=5 topMargin=10 rightmargin="0" bottommargin="0" >
<table width="99%" border="0" align="center" cellpadding="2" cellspacing="2" bgcolor="#e6e6e6">
  <tr>
    <td align="center"><strong>查看社区管理员等级权限</strong></td>
  </tr>
</table>
	<ec:table 
		items="resultList"
		var="rs"	
		retrieveRowsCallback="limit"
        sortRowsCallback="limit"			
		action="${pageContext.request.contextPath}/club/admin/master_grade_permission_info.jsp"		
		title="社区管理员等级权限"		
		>
		<ec:parameter name="mgId" value="<%=mgId %>"/>	
		<ec:parameter name="queryFlag" value="0"/>	
		<ec:row>
				<ec:column property="PERMISSION_ID" title="序号" >
					<input type="checkbox" ${rs.FLAG} disabled  name="permissionId" value="${rs.PERMISSION_ID}">${rs.PERMISSION_ID}
				</ec:column>							
				<ec:column property="PERMISSION_CODE" title="权限代号"/>
				<ec:column property="PERMISSION_NAME" title="权限名称"/>						
				<ec:column property="1" title="操作" sortable="false" viewsAllowed="html">
					<input type="button" name="btnEdit" value="增/删" onclick="javascript:updatePermission(${rs.PERMISSION_CODE},'${rs.FLAG}')">
				</ec:column>				
		</ec:row>
	</ec:table>
			<table border="0" width="100%">
				<tr valign="top">
					<td align="right">
					<button class="btn" accessKey=r id="btnRefresh" name="btnRefresh" title="刷新当前页面" onclick="javascript:location.reload();this.disabled=true;">刷新(<u>R</u>)</button>
					&nbsp;&nbsp;&nbsp;<td>
				</tr>
			</table>	
</body>
</html>
